home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Click 1 (Special Issue)
/
fantasy.iso
/
Demo The Druid King
/
DemoMap.pak
/
SEQUENCES_S05_MAIN.VS
< prev
next >
Wrap
Text File
|
2001-04-11
|
7KB
|
215 lines
//void
Conversation conv;
NamedObj Keltill, Daranix, Pavonius, Dumnorix, Ogox, Mrax;
ObjSet RomanArmy, TeutonArmy, TeutonHorde, TeutonHorde2, TeutonHorde3, GaulsOutpost;
Building outpost;
TPoint pt;
bool bMessageDelivered, bPavoniusHere, bFirst, bFirst2;
ObjList dummy;
TRect rc, rcBattle;
int nTeutons, tmBattle;
int count;
/*
//init part - remove this afterwards
CreateNamedObj("Keltill", PlaceEx("Keltill", 1400, 12500, 1));
CreateNamedObj("Daranix", PlaceEx("Daranix", 1600, 12500, 1));
PlaceBlockEx("Pretorian", 3, 3200, 9000, 5, 5, 50, 50, "PavoniusArmy");
CreateNamedObj("Pavonius", PlaceEx("Pavonius", 3350, 8900, 3));
RomanArmy = GetObjSet("PavoniusArmy");
Pavonius = GetNamedObj("Pavonius");
RomanArmy.AddCommand(true,"attach", Pavonius.obj);
RomanArmy.KillCommand();
PlayersShareView(1,3);
EnvWriteString("/DM C1/Return Value", "stay");
*/
//init part - this must remain
PlayersAlly(1,3);
PlayersAlly(3,4);
PlayersAlly(1,4);
PlayersShareView(1,4);
Keltill = GetNamedObj("Keltill");
Daranix = GetNamedObj("Daranix");
Dumnorix = GetNamedObj("Dumnorix");
Pavonius = GetNamedObj("Pavonius");
Ogox = GetNamedObj("Ogox");
Mrax = GetNamedObj("Mrax");
RomanArmy = GetObjSet("PavoniusArmy");
TeutonArmy = GetObjSet("TeutonArmy");
TeutonHorde = GetObjSet("TeutonHorde");
TeutonHorde2 = GetObjSet("TeutonHorde2");
TeutonHorde3 = GetObjSet("TeutonHorde3");
GaulsOutpost = GetObjSet("GaulsOutpost");
rc.Set(9300,3000,10500,4100);
dummy.AddBuildingsInRect(rc, 1);
outpost = dummy[0].AsBuilding;
if (!outpost.IsValid()) pr("The outpost has been moved");
pt.Set(1400,12500);
View(pt, false);
// determine the state of conv 14 (roman messenger to pavonius)
bMessageDelivered = (EnvReadString ("/DM C14/Return Value") == "True");
bPavoniusHere = (EnvReadString("/DM C1/Return Value") == "stay");
PlaceBlockEx("GArcher", 1, 9600, 4000, 5, 1, 25, 45, "GaulsOutpost");
GaulsOutpost.AddCommand(true, "enter", outpost );
GaulsOutpost.KillCommand();
PlaceBlockEx("TeutonWolf", 2, 13650, 1100, 3, 8, 50, 100, "TeutonHorde");
PlaceBlockEx("TeutonMetal", 2, 13800, 1100, 3, 8, 50, 100, "TeutonHorde");
nTeutons = 3*8 + 3*8; //total number of teutons
//spawn pavonius and his army if needed
//if (Pavonius.IsValid)
//Start conv. 16 - the box is empty
if (!Daranix.IsDead() && Daranix.obj.AsUnit().FindInvItem("box").IsValid()) {
Keltill.obj.AddCommand(true, "approach", Daranix.obj);
while (Keltill.obj.script == "approach" ) Sleep(500);
conv.Init("DM C16",2, 0);
conv.Run();
}
//if pavonius army is on the map - it comes in the camp
//otherwise if
if (bPavoniusHere) {
PlayersShareControl(1,3); //for now we're friends
//Pavonius.obj.AddCommand(true,"advance", point(1500,12500));
//Pavonius.obj.KillCommand();
}
//give note 7
EnvWriteInt("/NewNote", 7);
Run("CurrentMap/mission_notes.vs");
while (1) {
//if (Keltill.obj.AsHero.army.Count() + Daranix.obj.AsHero.army.Count() + Ogox.obj.AsHero.army.Count() > 50) break;
count=0;
if (!Daranix.IsDead()) count += Daranix.obj.AsHero.army.Count();
if (!Ogox.IsDead()) count += Ogox.obj.AsHero.army.Count();
if (!Dumnorix.IsDead()) count += Dumnorix.obj.AsHero.army.Count();
if (!Keltill.IsDead()) count += Keltill.obj.AsHero.army.Count();
if (!Mrax.IsDead()) count += Mrax.obj.AsHero.army.Count();
if (count > 50) break;
Sleep(500);
}
/*
//after a pause a Teuton army starts entering the map from south.
Sleep(10000);
PlaceBlockEx("TeutonWolf", 2, 950, 15000, 4, 8, 80, 100, "TeutonArmy");
TeutonArmy.AddCommandOffset(true,"advance", point(1500,12700));
TeutonArmy.KillCommand();
//wait for the "warm up" battle to finish
while (1) {
if (TeutonArmy.Count() == 0) break;
Sleep(500);
}
*/
// View(point(13650, 1100), false);
// SetPlayer(2);
TeutonHorde.AddCommandOffset(true, "advance", point(9600, 4000));
TeutonHorde.AddCommandOffset(false, "advance", point(6300, 6200));
TeutonHorde.AddCommandOffset(false, "advance", point(7100, 9000));
TeutonHorde.KillCommand();
//wait for them to pass near the outpost
rc.Set(10231,3634,10636,4020);
while (1) {
if (TeutonHorde.InRect(rc) > 0) break;
Sleep(500);
}
View(outpost.pos, false);
Sleep(5000);
EnvWriteInt("/NewNote", 13);
Run("CurrentMap/mission_notes.vs");
//wait for the battle to start
while (1) {
if (TeutonHorde.Count() != nTeutons) break;//someone is killed, therefore the battle has begun
Sleep(1000);
}
//pr("battle starts");
//spawn another horde
PlaceBlockEx("TeutonWolf", 2, 13650, 1100, 3, 8, 50, 100, "TeutonHorde2");
PlaceBlockEx("TeutonMetal", 2, 13800, 1100, 3, 8, 50, 100, "TeutonHorde2");
TeutonHorde2.AddCommandOffset(true, "advance", point(9600, 4000));
TeutonHorde2.AddCommandOffset(false, "advance", point(6300, 6200));
TeutonHorde2.AddCommandOffset(false, "advance", point(7100, 9000));
TeutonHorde2.KillCommand();
//wait the first 10 seconds of the battle, then decide on which side is pavonius
tmBattle = GetTime();
// rcBattle.Set(6200,8800,7200,9700);
bFirst = true;
bFirst2 = true;
while (1) {
if (Keltill.IsDead) break;
if (TeutonHorde.Count() + TeutonHorde2.Count() + TeutonHorde3.Count() == 0 && !bFirst2) break;
if (bFirst)
if (GetTime() - tmBattle > 10000) {
bFirst = false;
if (bMessageDelivered) {
PlayersMakeEnemies(1,3);
//todo: players should not share control
}
}
if (bFirst2)
if (GetTime() - tmBattle > 5000) {
bFirst2 = false;
PlaceBlockEx("TeutonWolf", 2, 13650, 1100, 3, 8, 50, 100, "TeutonHorde3");
PlaceBlockEx("TeutonMetal", 2, 13800, 1100, 3, 8, 50, 100, "TeutonHorde3");
TeutonHorde3.AddCommandOffset(true, "advance", point(9600, 4000));
TeutonHorde3.AddCommandOffset(false, "advance", point(6300, 6200));
TeutonHorde3.AddCommandOffset(false, "advance", point(7100, 9000));
TeutonHorde3.KillCommand();
}
Sleep(1000);
}
if (bMessageDelivered) //== Pavonius is enemy
while (1) {
if (Keltill.IsDead) break;
if (RomanArmy.Count() == 0) break;
Sleep(500);
}
//When no Teuton and Roman units and Roman units if message delivered left on the map, Daranix becomes
//GCH and moves to Keltill. When near, trigger CONVERSATION 17 - You are victorious.
if (!Daranix.IsDead() && !Keltill.IsDead()) {
Daranix.obj.AddCommand(true, "approach", Keltill.obj);
Daranix.obj.KillCommand();
while (Daranix.obj.script == "approach") Sleep(500);
conv.Init("DM C17", 2, 0);
conv.Run();
}
cls();
pr("This is the end of this demo.");
pr("Press Alt-F4 to exit.");
//End of mission